﻿using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace SAFPodcast.WP8.DTO.Entities
{
    [Table]
    public class Errors
    {
        [Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
        public int Id { get; set; }

        [Column]
        public String Message { get; set; }

        [Column]
        public String ExceptionStack { get; set; }

        [Column(IsVersion = true)]
        protected Binary _version;

        public override string ToString()
        {
            return String.Format("Id: {0}\nMessage: {1}\nException: {2}\n\n\n\n", Id, Message, ExceptionStack);
        }
    }
}
